home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!devmaccn.demon.co.uk
- From: Alan Griffiths <aGriffiths@ma.ccngroup.com>
- Newsgroups: comp.lang.c++
- Subject: Re: MS VC++ 4.0 namespace weirdness
- Date: Thu, 28 Mar 1996 10:06:33 GMT
- Organization: CCN Market Analysis
- Distribution: world
- Message-ID: <475745934wnr@ma.ccngroup.com>
- References: <4iq8up$hl3@news1.h1.usa.pipeline.com> <4ip987$aj5@druid.borland.com>
- Reply-To: aGriffiths@ma.ccngroup.com
- X-NNTP-Posting-Host: devmaccn.demon.co.uk
- X-Broken-Date: Thursday, Mar 28, 1996 10.06.33 GMT
- X-Newsreader: Newswin Alpha 0.6
- X-Mail2News-Path: devmaccn.demon.co.uk
-
- In article: <4iq8up$hl3@news1.h1.usa.pipeline.com> grantp@usa.pipeline.com(Pete Grant) writes:
- >
- > [snip]
- > I have used namespace declarations inside header files, as in FOO1 above,
- > and have had no problems. The namespaces behave precisely as expected when
- > compiled with MSVC++4.0/4.1.
-
- Then your expectation is wrong...
-
- #include <assert.h>
-
- namespace MyNamespace
- {
- int i = 1;
- }
-
- int main()
- {
- int i = 2;
-
- using namespace MyNamespace;
-
- assert(2 == i); // fails with MSVC4
-
- return 0;
- }
-
- Alan Griffiths | Also editor of: The ISDF Newsletter
- Senior Systems Consultant, | (An Association of C and C++ Users publication)
- CCN Group Limited. | (ISDF editor : isdf@octopull.demon.co.uk)
- (agriffiths@ma.ccngroup.com) | (For ACCU see : http://bach.cis.temple.edu/accu)
-
-